rust-bindings: update for soft-reboot
authorJoseph Marrero Corchado <jmarrero@redhat.com>
Mon, 30 Jun 2025 19:21:34 +0000 (15:21 -0400)
committerJoseph Marrero Corchado <jmarrero@redhat.com>
Wed, 9 Jul 2025 17:39:22 +0000 (13:39 -0400)
rust-bindings/src/auto/deployment.rs
rust-bindings/src/auto/repo.rs
rust-bindings/src/auto/sysroot.rs
rust-bindings/src/auto/versions.txt
rust-bindings/sys/src/auto/versions.txt
rust-bindings/sys/src/lib.rs

index ceee64a018bb6394a253c1074a93760badb08f02..756e782dd1ed57a7abb4baf4b502d83be451309b 100644 (file)
@@ -2,11 +2,11 @@
 // from gir-files
 // DO NOT EDIT
 
-use crate::{ffi,BootconfigParser};
 #[cfg(feature = "v2016_4")]
 #[cfg_attr(docsrs, doc(cfg(feature = "v2016_4")))]
-use crate::{DeploymentUnlockedState};
-use glib::{translate::*};
+use crate::DeploymentUnlockedState;
+use crate::{ffi, BootconfigParser};
+use glib::translate::*;
 
 glib::wrapper! {
     #[doc(alias = "OstreeDeployment")]
@@ -19,97 +19,100 @@ glib::wrapper! {
 
 impl Deployment {
     #[doc(alias = "ostree_deployment_new")]
-    pub fn new(index: i32, osname: &str, csum: &str, deployserial: i32, bootcsum: Option<&str>, bootserial: i32) -> Deployment {
-        unsafe {
-            from_glib_full(ffi::ostree_deployment_new(index, osname.to_glib_none().0, csum.to_glib_none().0, deployserial, bootcsum.to_glib_none().0, bootserial))
+    pub fn new(
+        index: i32,
+        osname: &str,
+        csum: &str,
+        deployserial: i32,
+        bootcsum: Option<&str>,
+        bootserial: i32,
+    ) -> Deployment {
+        unsafe {
+            from_glib_full(ffi::ostree_deployment_new(
+                index,
+                osname.to_glib_none().0,
+                csum.to_glib_none().0,
+                deployserial,
+                bootcsum.to_glib_none().0,
+                bootserial,
+            ))
         }
     }
 
     #[doc(alias = "ostree_deployment_clone")]
-#[must_use]
+    #[must_use]
     pub fn clone(&self) -> Deployment {
-        unsafe {
-            from_glib_full(ffi::ostree_deployment_clone(self.to_glib_none().0))
-        }
+        unsafe { from_glib_full(ffi::ostree_deployment_clone(self.to_glib_none().0)) }
     }
 
     #[doc(alias = "ostree_deployment_equal")]
     pub fn equal(&self, bp: &Deployment) -> bool {
         unsafe {
-            from_glib(ffi::ostree_deployment_equal(ToGlibPtr::<*mut ffi::OstreeDeployment>::to_glib_none(self).0 as glib::ffi::gconstpointer, ToGlibPtr::<*mut ffi::OstreeDeployment>::to_glib_none(bp).0 as glib::ffi::gconstpointer))
+            from_glib(ffi::ostree_deployment_equal(
+                ToGlibPtr::<*mut ffi::OstreeDeployment>::to_glib_none(self).0
+                    as glib::ffi::gconstpointer,
+                ToGlibPtr::<*mut ffi::OstreeDeployment>::to_glib_none(bp).0
+                    as glib::ffi::gconstpointer,
+            ))
         }
     }
 
     #[doc(alias = "ostree_deployment_get_bootconfig")]
     #[doc(alias = "get_bootconfig")]
     pub fn bootconfig(&self) -> Option<BootconfigParser> {
-        unsafe {
-            from_glib_none(ffi::ostree_deployment_get_bootconfig(self.to_glib_none().0))
-        }
+        unsafe { from_glib_none(ffi::ostree_deployment_get_bootconfig(self.to_glib_none().0)) }
     }
 
     #[doc(alias = "ostree_deployment_get_bootcsum")]
     #[doc(alias = "get_bootcsum")]
     pub fn bootcsum(&self) -> glib::GString {
-        unsafe {
-            from_glib_none(ffi::ostree_deployment_get_bootcsum(self.to_glib_none().0))
-        }
+        unsafe { from_glib_none(ffi::ostree_deployment_get_bootcsum(self.to_glib_none().0)) }
     }
 
     #[doc(alias = "ostree_deployment_get_bootserial")]
     #[doc(alias = "get_bootserial")]
     pub fn bootserial(&self) -> i32 {
-        unsafe {
-            ffi::ostree_deployment_get_bootserial(self.to_glib_none().0)
-        }
+        unsafe { ffi::ostree_deployment_get_bootserial(self.to_glib_none().0) }
     }
 
     #[doc(alias = "ostree_deployment_get_csum")]
     #[doc(alias = "get_csum")]
     pub fn csum(&self) -> glib::GString {
-        unsafe {
-            from_glib_none(ffi::ostree_deployment_get_csum(self.to_glib_none().0))
-        }
+        unsafe { from_glib_none(ffi::ostree_deployment_get_csum(self.to_glib_none().0)) }
     }
 
     #[doc(alias = "ostree_deployment_get_deployserial")]
     #[doc(alias = "get_deployserial")]
     pub fn deployserial(&self) -> i32 {
-        unsafe {
-            ffi::ostree_deployment_get_deployserial(self.to_glib_none().0)
-        }
+        unsafe { ffi::ostree_deployment_get_deployserial(self.to_glib_none().0) }
     }
 
     #[doc(alias = "ostree_deployment_get_index")]
     #[doc(alias = "get_index")]
     pub fn index(&self) -> i32 {
-        unsafe {
-            ffi::ostree_deployment_get_index(self.to_glib_none().0)
-        }
+        unsafe { ffi::ostree_deployment_get_index(self.to_glib_none().0) }
     }
 
     #[doc(alias = "ostree_deployment_get_origin")]
     #[doc(alias = "get_origin")]
     pub fn origin(&self) -> Option<glib::KeyFile> {
-        unsafe {
-            from_glib_none(ffi::ostree_deployment_get_origin(self.to_glib_none().0))
-        }
+        unsafe { from_glib_none(ffi::ostree_deployment_get_origin(self.to_glib_none().0)) }
     }
 
     #[doc(alias = "ostree_deployment_get_origin_relpath")]
     #[doc(alias = "get_origin_relpath")]
     pub fn origin_relpath(&self) -> glib::GString {
         unsafe {
-            from_glib_full(ffi::ostree_deployment_get_origin_relpath(self.to_glib_none().0))
+            from_glib_full(ffi::ostree_deployment_get_origin_relpath(
+                self.to_glib_none().0,
+            ))
         }
     }
 
     #[doc(alias = "ostree_deployment_get_osname")]
     #[doc(alias = "get_osname")]
     pub fn osname(&self) -> glib::GString {
-        unsafe {
-            from_glib_none(ffi::ostree_deployment_get_osname(self.to_glib_none().0))
-        }
+        unsafe { from_glib_none(ffi::ostree_deployment_get_osname(self.to_glib_none().0)) }
     }
 
     #[cfg(feature = "v2016_4")]
@@ -117,15 +120,16 @@ impl Deployment {
     #[doc(alias = "ostree_deployment_get_unlocked")]
     #[doc(alias = "get_unlocked")]
     pub fn unlocked(&self) -> DeploymentUnlockedState {
-        unsafe {
-            from_glib(ffi::ostree_deployment_get_unlocked(self.to_glib_none().0))
-        }
+        unsafe { from_glib(ffi::ostree_deployment_get_unlocked(self.to_glib_none().0)) }
     }
 
     #[doc(alias = "ostree_deployment_hash")]
     pub fn hash(&self) -> u32 {
         unsafe {
-            ffi::ostree_deployment_hash(ToGlibPtr::<*mut ffi::OstreeDeployment>::to_glib_none(self).0 as glib::ffi::gconstpointer)
+            ffi::ostree_deployment_hash(
+                ToGlibPtr::<*mut ffi::OstreeDeployment>::to_glib_none(self).0
+                    as glib::ffi::gconstpointer,
+            )
         }
     }
 
@@ -134,7 +138,9 @@ impl Deployment {
     #[doc(alias = "ostree_deployment_is_finalization_locked")]
     pub fn is_finalization_locked(&self) -> bool {
         unsafe {
-            from_glib(ffi::ostree_deployment_is_finalization_locked(self.to_glib_none().0))
+            from_glib(ffi::ostree_deployment_is_finalization_locked(
+                self.to_glib_none().0,
+            ))
         }
     }
 
@@ -142,8 +148,15 @@ impl Deployment {
     #[cfg_attr(docsrs, doc(cfg(feature = "v2018_3")))]
     #[doc(alias = "ostree_deployment_is_pinned")]
     pub fn is_pinned(&self) -> bool {
+        unsafe { from_glib(ffi::ostree_deployment_is_pinned(self.to_glib_none().0)) }
+    }
+
+    #[doc(alias = "ostree_deployment_is_soft_reboot_target")]
+    pub fn is_soft_reboot_target(&self) -> bool {
         unsafe {
-            from_glib(ffi::ostree_deployment_is_pinned(self.to_glib_none().0))
+            from_glib(ffi::ostree_deployment_is_soft_reboot_target(
+                self.to_glib_none().0,
+            ))
         }
     }
 
@@ -151,15 +164,16 @@ impl Deployment {
     #[cfg_attr(docsrs, doc(cfg(feature = "v2018_3")))]
     #[doc(alias = "ostree_deployment_is_staged")]
     pub fn is_staged(&self) -> bool {
-        unsafe {
-            from_glib(ffi::ostree_deployment_is_staged(self.to_glib_none().0))
-        }
+        unsafe { from_glib(ffi::ostree_deployment_is_staged(self.to_glib_none().0)) }
     }
 
     #[doc(alias = "ostree_deployment_set_bootconfig")]
     pub fn set_bootconfig(&self, bootconfig: Option<&BootconfigParser>) {
         unsafe {
-            ffi::ostree_deployment_set_bootconfig(self.to_glib_none().0, bootconfig.to_glib_none().0);
+            ffi::ostree_deployment_set_bootconfig(
+                self.to_glib_none().0,
+                bootconfig.to_glib_none().0,
+            );
         }
     }
 
@@ -198,7 +212,9 @@ impl Deployment {
     #[doc(alias = "ostree_deployment_unlocked_state_to_string")]
     pub fn unlocked_state_to_string(state: DeploymentUnlockedState) -> glib::GString {
         unsafe {
-            from_glib_none(ffi::ostree_deployment_unlocked_state_to_string(state.into_glib()))
+            from_glib_none(ffi::ostree_deployment_unlocked_state_to_string(
+                state.into_glib(),
+            ))
         }
     }
 }
index 21ae041f7f78a0cb2b61d87d8375c3a6bfdd7fd2..c886343959969c8a6f03eae6bfcf65f310944ec7 100644 (file)
@@ -435,7 +435,7 @@ impl Repo {
     //}
 
     //#[doc(alias = "ostree_repo_list_objects")]
-    //pub fn list_objects(&self, flags: RepoListObjectsFlags, out_objects: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 2, id: 222 }/TypeId { ns_id: 2, id: 222 }, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<(), glib::Error> {
+    //pub fn list_objects(&self, flags: RepoListObjectsFlags, out_objects: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 2, id: 226 }/TypeId { ns_id: 2, id: 226 }, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<(), glib::Error> {
     //    unsafe { TODO: call ffi:ostree_repo_list_objects() }
     //}
 
@@ -1076,7 +1076,7 @@ impl Repo {
     }
 
     //#[doc(alias = "ostree_repo_traverse_commit")]
-    //pub fn traverse_commit(&self, commit_checksum: &str, maxdepth: i32, out_reachable: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 2, id: 222 }/TypeId { ns_id: 2, id: 222 }, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<(), glib::Error> {
+    //pub fn traverse_commit(&self, commit_checksum: &str, maxdepth: i32, out_reachable: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 2, id: 226 }/TypeId { ns_id: 2, id: 226 }, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<(), glib::Error> {
     //    unsafe { TODO: call ffi:ostree_repo_traverse_commit() }
     //}
 
@@ -1102,7 +1102,7 @@ impl Repo {
     //#[cfg(feature = "v2018_6")]
     //#[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))]
     //#[doc(alias = "ostree_repo_traverse_reachable_refs")]
-    //pub fn traverse_reachable_refs(&self, depth: u32, reachable: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 2, id: 222 }/TypeId { ns_id: 2, id: 222 }, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<(), glib::Error> {
+    //pub fn traverse_reachable_refs(&self, depth: u32, reachable: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 2, id: 226 }/TypeId { ns_id: 2, id: 226 }, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<(), glib::Error> {
     //    unsafe { TODO: call ffi:ostree_repo_traverse_reachable_refs() }
     //}
 
@@ -1353,12 +1353,12 @@ impl Repo {
     //#[cfg(feature = "v2018_5")]
     //#[cfg_attr(docsrs, doc(cfg(feature = "v2018_5")))]
     //#[doc(alias = "ostree_repo_traverse_new_parents")]
-    //pub fn traverse_new_parents() -> /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 2, id: 222 }/TypeId { ns_id: 2, id: 222 } {
+    //pub fn traverse_new_parents() -> /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 2, id: 226 }/TypeId { ns_id: 2, id: 226 } {
     //    unsafe { TODO: call ffi:ostree_repo_traverse_new_parents() }
     //}
 
     //#[doc(alias = "ostree_repo_traverse_new_reachable")]
-    //pub fn traverse_new_reachable() -> /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 2, id: 222 }/TypeId { ns_id: 2, id: 222 } {
+    //pub fn traverse_new_reachable() -> /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 2, id: 226 }/TypeId { ns_id: 2, id: 226 } {
     //    unsafe { TODO: call ffi:ostree_repo_traverse_new_reachable() }
     //}
 
index e0e90e9297fa878b86f425622c7fc794a03e15d0..250b01b46752c7443d0160ddec37f79ee6179581 100644 (file)
@@ -100,6 +100,13 @@ impl Sysroot {
         }
     }
 
+    #[doc(alias = "ostree_sysroot_deployment_can_soft_reboot")]
+    pub fn deployment_can_soft_reboot(&self, deployment: &Deployment) -> bool {
+        unsafe {
+            from_glib(ffi::ostree_sysroot_deployment_can_soft_reboot(self.to_glib_none().0, deployment.to_glib_none().0))
+        }
+    }
+
     #[cfg(feature = "v2025_1")]
     #[cfg_attr(docsrs, doc(cfg(feature = "v2025_1")))]
     #[doc(alias = "ostree_sysroot_deployment_kexec_load")]
@@ -112,6 +119,16 @@ impl Sysroot {
         }
     }
 
+    #[doc(alias = "ostree_sysroot_deployment_prepare_next_root")]
+    pub fn deployment_prepare_next_root(&self, deployment: &Deployment, allow_kernel_skew: bool, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<(), glib::Error> {
+        unsafe {
+            let mut error = std::ptr::null_mut();
+            let is_ok = ffi::ostree_sysroot_deployment_prepare_next_root(self.to_glib_none().0, deployment.to_glib_none().0, allow_kernel_skew.into_glib(), cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
+            debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null());
+            if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
+        }
+    }
+
     #[doc(alias = "ostree_sysroot_deployment_set_kargs")]
     pub fn deployment_set_kargs(&self, deployment: &Deployment, new_kargs: &[&str], cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<(), glib::Error> {
         unsafe {
index f46cfa17ccd5e2f137443b22cc0a11fa8f5bb3c7..00a536578480dd87e83eca01a4eb6bbef152c23d 100644 (file)
@@ -1,2 +1,2 @@
 Generated by gir (https://github.com/gtk-rs/gir @ 5433e2582f83)
-from gir-files (@ 7a32b86ee4c0)
+from gir-files (@ 38af5498595a)
index f46cfa17ccd5e2f137443b22cc0a11fa8f5bb3c7..00a536578480dd87e83eca01a4eb6bbef152c23d 100644 (file)
@@ -1,2 +1,2 @@
 Generated by gir (https://github.com/gtk-rs/gir @ 5433e2582f83)
-from gir-files (@ 7a32b86ee4c0)
+from gir-files (@ 38af5498595a)
index e79027f3b165a6db6fbfc0e99d2423e093cf7843..3dadf9cfa264e9dbf152651561c77d39d61816c3 100644 (file)
@@ -1670,6 +1670,7 @@ extern "C" {
     #[cfg(feature = "v2018_3")]
     #[cfg_attr(docsrs, doc(cfg(feature = "v2018_3")))]
     pub fn ostree_deployment_is_pinned(self_: *mut OstreeDeployment) -> gboolean;
+    pub fn ostree_deployment_is_soft_reboot_target(self_: *mut OstreeDeployment) -> gboolean;
     #[cfg(feature = "v2018_3")]
     #[cfg_attr(docsrs, doc(cfg(feature = "v2018_3")))]
     pub fn ostree_deployment_is_staged(self_: *mut OstreeDeployment) -> gboolean;
@@ -3125,6 +3126,10 @@ extern "C" {
         cancellable: *mut gio::GCancellable,
         error: *mut *mut glib::GError,
     ) -> gboolean;
+    pub fn ostree_sysroot_deployment_can_soft_reboot(
+        self_: *mut OstreeSysroot,
+        deployment: *mut OstreeDeployment,
+    ) -> gboolean;
     #[cfg(feature = "v2025_1")]
     #[cfg_attr(docsrs, doc(cfg(feature = "v2025_1")))]
     pub fn ostree_sysroot_deployment_kexec_load(
@@ -3133,6 +3138,13 @@ extern "C" {
         cancellable: *mut gio::GCancellable,
         error: *mut *mut glib::GError,
     ) -> gboolean;
+    pub fn ostree_sysroot_deployment_prepare_next_root(
+        self_: *mut OstreeSysroot,
+        deployment: *mut OstreeDeployment,
+        allow_kernel_skew: gboolean,
+        cancellable: *mut gio::GCancellable,
+        error: *mut *mut glib::GError,
+    ) -> gboolean;
     pub fn ostree_sysroot_deployment_set_kargs(
         self_: *mut OstreeSysroot,
         deployment: *mut OstreeDeployment,